package com.tencent.iov.cowin.befsale.clue.value.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

/**
 * @Describe: 计划跟进时间code
 * @author: xiamnu
 * @created: 2021-12-01 18:22:10
 * @version: 1.0
 */
@Getter
@AllArgsConstructor
public enum PlanFollowTimeCodeEnum {
    //计划跟进时间code
    FOLLOW_TIME_CODE_DAY("plan_follow_time_code_001","一天后", 1),
    FOLLOW_TIME_CODE_THIRD_DAY("plan_follow_time_code_002","三天后", 3),
    FOLLOW_TIME_CODE_WEEK_DAY("plan_follow_time_code_003","一周后", 7),
    //周六
    FOLLOW_TIME_CODE_IN_WEEK("plan_follow_time_code_004","周末", 0),
    FOLLOW_TIME_CODE_FREE("plan_follow_time_code_005","自定义", -1)
    ;

    String code;
    String name;
    Integer day;


    /**
     * 跟进type获
     * @param code
     * @return
     */
    public static PlanFollowTimeCodeEnum getPlanFollowTimeCodeEnum(String code){
        return Stream.of(PlanFollowTimeCodeEnum.values())
                .filter(enums -> enums.code.equals(code))
                .findAny().orElse(null);
    }
}
